<?php
/*
 * 频道模型-字段模板
 */
class cfieldtplAction extends commonAction{
    
    //模板列表
    function index(){
        $cfieldM=D('ChannelFieldtpl');
        $list=$cfieldM->getList();
        $this->assign('list',$list);
        $this->display();
    }
    
    //添加模板
    function add(){
        if(!$this->isPost()){
            $this->display();
        }else{
            $cfieldM=D('ChannelFieldtpl');
            if($cfieldM->create()){
                if(!$cfieldM->add()){
                    $this->error($cfieldM->getDbError());
                }else{
                    $this->success("添加成功");
                }
            }else{
                $this->error($cfieldM->getError());
            }
        }
    }
    
    //编辑模板
    function edit(){
        
    }
    
    //删除模板
    function delete(){
        
        
    }
}
